from loguru import logger
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent
logger.add(
    "log/stock_change_{time}.log",
    encoding="utf-8",
    level="INFO",
    rotation="5 MB",
    retention="24 h",
)
HOST = "192.168.8.5"
PORT = 8081
static_img_url = "./static/stock_img/"
interval_count = 5
# 是否检测
is_check = True
# 非交易时间发送消息间隔 8 * 7 56秒一次
msg_interval = int(60 / interval_count)
current_type = ""
# 清理日志间隔时间
clear_hours = 12
xg_hours = 22

# 涨速配置
start_seed = 0.8
normal_seed = 0.8



count = 0


search1 = "流通市值小于300亿，量比大于1.3，涨幅大于2，股价大于均线价，分时均价线向上，均线多头排列，股价大于9日均线，9日均线向上，昨日换手率大于4%，获利比率大于80%，屏蔽创业板，屏蔽科创板"
# 降低换手率， 去除市值， 去除均线排列
search2 = "量比大于1.3，涨幅大于2，股价大于均线价，分时均价线向上，股价大于9日均线，9日均线向上，昨日换手率大于3%，获利比率大于80%，屏蔽创业板，屏蔽BJ， 屏蔽科创板"
search3 = "20天以内跌幅10%小于1次，排除st,排除创业板，排除科创板，20天内的上涨大于6%次数>=1次， 20天内的涨停次数<3次"
search4 = "dde大单净量大于0.3，dde大单净量从大到小，排除科创板，排除创业板，排除北交所"

dd_secret1 = "SEC9eb7bdb73ca330a0198f17022f73d22dac3e8f0bc8ad348b336fd5980030d966"
dd_uri1 = "https://oapi.dingtalk.com/robot/send?access_token=24cba02b2546038963ac24d4b7045f68280dfcfca642a6729b7afba995b9e2f8&sign"
# 企微涨速机器人
wx_uri1 = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=02b2b073-99cd-44e7-9455-eb024b1c9fa5"
# 企微问财1 带市值参数
wx_uri2 = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=613319d2-9275-4602-a5b4-19adbb0c4438"
# 企微问财2 不带市值参数
wx_uri3 = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=997dbdd8-5bcd-4e5f-b198-ccb8806d16bb"
